package com.zjj.rabbitmq.hello;

import java.util.Date;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HelloSender {

	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void send() {
		String context = "zjj " + new Date();
		System.out.println("发送者 : " + context);
		this.rabbitTemplate.convertAndSend("zjj", context);
	}
}